home *** CD-ROM | disk | FTP | other *** search
- /*
- File: UDocumentSecondStomach.h
-
- Contains: *** put contents here ***
-
- Written by: Steve Datnow
-
- Copyright: © 1992 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- 8/18/93 SLD Add Disconnect Method
- 1/7/92 SLD Created
-
- To Do:
- */
-
-
- #ifndef __UDOCUMENTSecondStomach__
- #define __UDOCUMENTSecondStomach__
-
- #ifndef __UViewStatusInfo__
- #include "UViewStatusInfo.h"
- #endif
-
- #ifndef __UFILEBASEDDOCUMENT__
- #include <UFileBasedDocument.h>
- #endif
-
- //----------------------------------------------------------------------------------------
- // Constants
- //----------------------------------------------------------------------------------------
-
- // Commands
- // const CommandNumber cCommandHandledByDocument = 401;
-
- // Files
- const OSType kFileType = 'SF01'; // File-type code used for document files
-
- const kViewsToGreyWhenDisconnected = 6001;
- //----------------------------------------------------------------------------------------
- // TDocumentSecondStomach
- //----------------------------------------------------------------------------------------
- class TTimerHandler;
-
- class TDocumentSecondStomach: public TFileBasedDocument
- {
- public:
-
- // Construction/Destruction
- virtual pascal void Initialize(); // Override
-
- virtual pascal void IDocumentSecondStomach(TFile* itsFile, OSType itsCreator);
- virtual pascal void DoInitialState(); // Override
- virtual pascal void FreeData(); // Override
- virtual pascal void Free(); // Override
-
- // Views
- virtual pascal void DoMakeViews(Boolean forPrinting); // Override
-
- // Commands
- virtual pascal void DoSetupMenus(); // Override
- virtual pascal void DoMenuCommand(CommandNumber aCommandNumber); // Override
-
- // Saving and Restoring
- virtual pascal void DoNeedDiskSpace(TFile* ,
- long& dataForkBytes,
- long& rsrcForkBytes); // Override
- virtual pascal void DoRead(TFile* aFile,
- Boolean forPrinting); // Override
- virtual pascal void DoWrite(TFile* aFile,
- Boolean makingCopy); // Override
-
- virtual pascal long GetSessionID();
-
- virtual pascal void HandleStatusInfo(TAppleEvent* theMessage);
-
- virtual pascal Boolean DoIdle(IdlePhase phase);
-
- virtual pascal void ResetTimer();
- virtual pascal Boolean TimerExpired();
-
- pascal OSErr EstablishSession();
- pascal void SendItemsToBeLogged();
-
- pascal void MonitoringChange(Boolean stopMonitoring);
-
- pascal void SetStatus(CStr255 message);
- pascal void BlinkStatus();
- pascal void AddToLog(CStr255 message);
-
- pascal void SendAliveMessage();
-
- pascal void SendButtonMessage(long buttonId);
- pascal void SendConfigMessage(TView* theView);
-
- pascal void GetConfigValue(TView* theView);
-
- pascal void Disconnect();
-
- public:
- Boolean fDisconnected;
- private:
- static long fUniqueSessionID;
- long fDocSessionID;
- TStatusItemList* fStatusList;
- AEAddressDesc fTargetAddress;
- unsigned long fHeartBeat;
- //long fSendAliveCounter;
- TDynamicArray* fItemsToBeMonitored;
- TTimerHandler* fTimerHandler;
- TViewlogStatusInfo* fLog;
- TViewMonitorStatus* fStatus;
- Boolean fReOpening;
- VRect fWinFrame;
- TargetID fTargetID;
- };
-
- class TDialogViewConfig : public TDialogView
- {
- public:
- virtual pascal void DoEvent(EventNumber eventNumber, TEventHandler* source,
- TEvent* event);
-
- virtual pascal void TDialogViewConfig::Open(void);
-
- };
-
-
- class TTimerHandler : public TEventHandler
- {
- public:
- virtual pascal void ITimerHandler(TDocumentSecondStomach* parentDoc);
- virtual pascal Boolean DoIdle(IdlePhase);
- private:
- TDocumentSecondStomach* fParentDoc;
- unsigned long fBaseTimer;
- };
-
- #endif
-